package com.gxy.learn.verify.web.req;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Description(参数vo)
 * author: Gao xueyong
 * Create at: 2020/4/12 7:26 下午
 */
@Data
public class ParamVo {
    @NotBlank(message = "code不能为null")
    private  String code;
    @NotBlank(message = "name不能为null")
    private  String name;
    @Size(min = 1,message = "interIds最少有一个值！")
    @NotNull(message = "interIds不能为null")
    private List<String> interIds;
    @Min(value = 5,message = "age最小不能低于5")
    @Max(value = 15,message = "age最大值不能超过15")
    @NotNull(message = "age不能为null,区间[5~15]")
    private Integer age;
    @Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$",message = "email格式不正确！")
    @NotBlank(message = "email不能为null")
    private String email;
    @NotNull(message = "pastDate不能为null")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Past(message = "pastDate必须是一个过去的时间！")
    private Date pastDate;
    @NotNull(message = "fatureDate不能为null")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Future(message = "fatureDate必须是一个将来的时间！")
    private Date fatureDate;

    @NotNull(message = "bgNum不能位null")
    @Digits(message = "bgNum数字的整数位个数不能超过2位，小数点位个数不能超过4位", integer = 2 , fraction =4 )
    private BigDecimal bgNum;
}
